package com.woniuxy.controller;

import com.woniuxy.pojo.NewsType;
import com.woniuxy.service.NewsTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/newsType")
public class NewsTypeController {

    @Autowired
    private NewsTypeService newsTypeService;
    @GetMapping("/getAllNewsTypes")
    public ResponseEntity<?> getAllNewsTypes(){
        List<NewsType> list = newsTypeService.list();
        return ResponseEntity.ok(list);
    }
}
